/
MessageRecipient.cs
85 lines (73 loc) · 2.68 KB
/
MessageRecipient.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
namespace DotNetNuke.Services.Social.Messaging
{
using System;
using System.Data;
using System.Xml.Serialization;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities;
using DotNetNuke.Entities.Modules;
using Newtonsoft.Json;
/// Project: DotNetNuke
/// Namespace: DotNetNuke.Entities.Messaging
/// Class: MessageRecipient
/// <summary>The MessageRecipient class is used to store the details of all recipients of a particular message.</summary>
[Serializable]
public class MessageRecipient : BaseEntityInfo, IHydratable
{
private int recipientID = -1;
/// <summary>Gets or sets recipientID - The primary key.</summary>
[XmlAttribute]
public int RecipientID
{
get
{
return this.recipientID;
}
set
{
this.recipientID = value;
}
}
/// <summary>Gets or sets the messageID of who sent the message to this recipient.</summary>
[XmlAttribute]
public int MessageID { get; set; }
/// <summary>Gets or sets the UserID of the user receiving the message.</summary>
[XmlAttribute]
public int UserID { get; set; }
/// <summary>Gets or sets a value indicating whether is Message read. True: Yes, False: No.</summary>
[XmlAttribute]
public bool Read { get; set; }
/// <summary>Gets or sets a value indicating whether is Message archived. True: Yes, False: No.</summary>
[XmlAttribute]
public bool Archived { get; set; }
/// <summary>Gets or sets iHydratable.KeyID.</summary>
[XmlIgnore]
[JsonIgnore]
public int KeyID
{
get
{
return this.RecipientID;
}
set
{
this.RecipientID = value;
}
}
/// <summary>Fill the object with data from database.</summary>
/// <param name="dr">the data reader.</param>
public void Fill(IDataReader dr)
{
this.RecipientID = Convert.ToInt32(dr["RecipientID"]);
this.MessageID = Convert.ToInt32(dr["MessageID"]);
this.UserID = Convert.ToInt32(dr["UserID"]);
this.Archived = Null.SetNullBoolean(dr["Archived"]);
this.Read = Null.SetNullBoolean(dr["Read"]);
// add audit column data
this.FillInternal(dr);
}
}
}